package com.text;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import jakarta.annotation.PostConstruct;

// 会创建scan的bean
@Component
public class AppServer {
    @Value("${name}")
    String name;

    @Value("${version}")
    String version;

    @Value("${appServiceInfo}")
    String appServiceInfo;

    @PostConstruct
    public void printInfo() {
        System.out.println("AppServer-name: " + name);
        System.out.println("AppServer-version: " + version);
        System.out.println("AppServer-appServiceInfo: " + appServiceInfo);
    }

    String getAppServiceInfo() {
        return appServiceInfo;
    }

    String getName() {
        return name;
    }

    String getVersion() {
        return version;
    }

}
